function test(list, ind) {
    if (ind < list.length) {
        if (ind < list.length - 1) {
            return list[ind] + '<' + test(list, ind + 1) + '>';
        }
        return list[ind];
    }
    return;
}
console.log(test(['Res', 'PageInfo', 'UserInfo'], 0));
console.log( test(['Res', 'UserInfo'], 0));
console.log( test(['Res'], 0));
